package com.sea.physical.service;



import com.sea.physical.entity.StockProduce;

import java.io.InputStream;
import java.util.List;

/**
 * 库存调拨剩余量服务层
 */
public interface StockProduceService {
    /**
     * 多条件查询
     * @param stockProduce
     * @return
     */
    List<StockProduce> findByCnd(StockProduce stockProduce);

    /**
     * 新增
     * @param stockProduce
     * @return
     */
    int save(StockProduce stockProduce);
    /**
     * 根据仓库ID和SKU获取剩余量
     * @param stockWareId
     * @param stockSku
     * @return
     */
    Integer getStockNumber(Integer stockWareId,String stockSku,Integer createNumber);
    /**
     * 获取可占用量
     * @param stockWareId
     * @param stockSku
     * @return
     */
    List<StockProduce> getUseNumber(Integer stockWareId,String stockSku);
    /**
     * 更新占有量
     * @param useNumber
     * @param id
     * @return
     */
    int updateUseNumber(Integer useNumber,Integer id);
    /**
     * 释放占有量以及消耗库存
     * @param useNumber
     * @param id
     * @return
     */
    int updateStockNumber(Integer useNumber,Integer id);
    /**
     * 释放占有量
     * @param useNumber
     * @param id
     * @return
     */
    int cancelUseNumber(Integer useNumber,Integer id);

    List<StockProduce> findSalesProduceNumber(StockProduce stockProduce);
    /**
     * 导入SKU
     * @param inputStream
     * @param fileName
     * @return
     * @throws Exception
     */
    void importSku(InputStream inputStream, String fileName) throws Exception;
    /**
     * 查询导入的数据
     * @param stockProduce
     * @return
     */
    StockProduce findByImportData(StockProduce stockProduce);
    /**
     *
     * @param stockProduce
     * @return
     */
    Integer updateImportUseNumber(StockProduce stockProduce);
}
